<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<jsp:include page="../layout/topPg.jsp" />

<!-- INI listSongsPg -->
	
	<table id="songsList">
		<tr>
			<th id="songsList_th_artist">
				<c:if test="${param.order != 'artist'}">
					<a href="../songs/doSearchSort.html?order=artist&direction=asc">
				</c:if>
				<c:if test="${param.order == 'artist'}">
					<c:if test="${param.direction == 'asc'}">
						<a href="../songs/doSearchSort.html?order=artist&direction=desc">
					</c:if>
					<c:if test="${param.direction != 'asc'}">
						<a href="../songs/doSearchSort.html?order=artist&direction=asc">
					</c:if>
				</c:if>
					Artist
					<img class="sortImg" src="../images/tables/sort.png"/>
				</a>
			</th>
			<th id="songsList_th_song">
				<c:if test="${param.order != 'song'}">
					<a href="../songs/doSearchSort.html?order=song&direction=asc">
				</c:if>
				<c:if test="${param.order == 'song'}">
					<c:if test="${param.direction == 'asc'}">
						<a href="../songs/doSearchSort.html?order=song&direction=desc">
					</c:if>
					<c:if test="${param.direction != 'asc'}">
						<a href="../songs/doSearchSort.html?order=song&direction=asc">
					</c:if>
				</c:if>
					Song
					<img class="sortImg" src="../images/tables/sort.png"/>
				</a>
			</th>
			<th id="songsList_th_tune">Tune</th>
			<th id="songsList_th_difficulty">G 1</th>
			<th id="songsList_th_difficulty">G 2</th>
			<th id="songsList_th_difficulty">G 3</th>
			<th id="songsList_th_difficulty">Bass</th>
			<th id="songsList_th_difficulty">Solo</th>
			<th id="songsList_th_actions">Actions</th>
		</tr>
		<c:forEach var="song" items="${songs}" varStatus="loopCount">
			<tr>
				<td>${song.artist}</td>
				<td>${song.song}</td>
				<td>${song.tune}</td>
				<td>${song.guitar1}</td>
				<td>${song.guitar2}</td>
				<td>${song.guitar3}</td>
				<td>${song.bass}</td>
				<td>${song.solo}</td>
				<td>
					<c:if test="${song.user == null}">
						<form class="imgTaula" action="../users/addMySong.html" method="POST">
							<input type="hidden" name="id" value="${song.id}">
							<input class="imgTaula" type="image" src="../images/buttons/add.png" alt="Add"/>
						</form>
					</c:if>
					<a href="../songs/${song.id}.html">
						<img class="imgTaula" src="../images/buttons/detail.png" alt="Edit"/>
					</a>
				</td>
			</tr>
		</c:forEach>
	</table>
	
<!-- FI listSongsPg -->

<jsp:include page="../layout/footerPg.jsp" />
